package database

import (
	"context"
	"github.com/jmoiron/sqlx"
	"go.mongodb.org/mongo-driver/mongo"
)

// SQLDatabase SQL数据库接口
type SQLDatabase interface {
	GetDB() *sqlx.DB
	Ping() error
	Close() error
}

// NoSQLDatabase NoSQL数据库接口
type NoSQLDatabase interface {
	GetClient() *mongo.Client
	GetDatabase() *mongo.Database
	GetCollection(name string) *mongo.Collection
	Ping() error
	Close() error
	WithTransaction(ctx context.Context, fn func(session mongo.Session) error) error
}
